# -- coding: utf-8 --
from reflection_demo import pet


class Master:

    def feed(self, type, name, age):
        mypet = getattr(pet, type)(name, age)
        mypet.eat()
        mypet.play()
        # if type == 'Cat':
        #     cat = Cat(name, age)
        #     cat.eat()
        #     cat.play()
        # elif type == 'Dog':
        #     dog = Dog(name, age)
        #     dog.eat()
        #     dog.play()
        # else:
        #     print('输入错误')


if __name__ == '__main__':

    m = Master()
    m.feed('Cat','小黑', 3)